Favorites

interface Favorites

This module provides methods for interacting with the user's favorites, allowing comprehensive management of favorite contacts and rooms.

The interface offers functionality to retrieve the complete list of favorites, search for a specific favorite by either its ID or the associated contact/room ID, and manage favorite entries. Users can create new favorites, delete existing ones, and modify the position of favorites in the list to suit their preferences.

Additionally, real-time notifications are available to keep users updated on changes to their favorites list.

Detailed information about each favorite entry is encapsulated within the IRainbowFavorite object, which contains all relevant data for individual favorite contacts or rooms.

Samples

com.ale.rainbowsdk.samples.FavoritesSample

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
abstract val favorites: ArrayItemList<IRainbowFavorite>

Retrieves the user's list of favorites.

Functions

Link copied to clipboard
abstract fun createFavorite(    peerId: String,     type: PeerType,     position: Int? = null,     listener: RainbowListener<IRainbowFavorite, CreateFavoriteError>? = null)

Creates a new favorite entry.

Link copied to clipboard
abstract fun createFavoriteFromContact(    contact: IRainbowContact,     position: Int? = null,     listener: RainbowListener<IRainbowFavorite, CreateFavoriteError>? = null)

Creates a new favorite entry from a contact.

Link copied to clipboard
abstract fun deleteFavorite(favoriteId: String, listener: RainbowListener<Unit, Unit>? = null)

Deletes an existing favorite.

Link copied to clipboard
abstract fun fetchFavorites(listener: RainbowListener<List<IRainbowFavorite>, Unit>? = null)

Fetches all favorites for the user.

Link copied to clipboard
abstract fun getFavoriteById(favoriteId: String): IRainbowFavorite?

Retrieves a favorite by its unique ID.

Link copied to clipboard
abstract fun getFavoriteByPeerId(peerId: String): IRainbowFavorite?

Retrieves a favorite by the associated peer ID.

Link copied to clipboard
abstract fun updateFavoritePosition(favoriteId: String, position: Int, listener: RainbowListener<IRainbowFavorite, Unit>? = null)

Updates the position of an existing favorite.